#include <OgreVector2.h>
#include "World.h"

#define STATIC 0
#define MOVABLE 1
#define ROTATABLE 2

class PolyFactory
{
  public:                             
    PolyFactory(World *world); 
    ~PolyFactory();
 
	void createTriangle(Ogre::String name, Ogre::Vector2 p1, Ogre::Vector2 p2, Ogre::Vector2 p3, Ogre::Real angle, bool showBounding);
	void createCube(Ogre::String name, Ogre::Vector2 p1, Ogre::Vector2 p2, Ogre::Vector2 p3, Ogre::Vector2 p4, Ogre::Real angle, bool showBounding);
	void createRoundedCube(Ogre::String name, Ogre::Vector2 p1, Ogre::Vector2 p2, Ogre::Vector2 p3, Ogre::Vector2 p4, Ogre::Real angle, bool showBounding);

	void createRectagle(Ogre::String name, Ogre::Vector2 position, Ogre::Real depth, Ogre::Real width, Ogre::Real height, Ogre::Real rotation, bool boundingVisible, bool enhancedCollisionShape, int type);

  private:                             
	Ogre::Vector2 rotatePoint(Ogre::Real angle);  
	Ogre::Vector2 addPolyToWorld(Poly polygon);
	World *m_world;

};